import { defineStore } from "pinia";
export const useCounterStore = defineStore("counter", () => {
  // ref变量相当于state属性
  const count = ref(0);

  //computed计算属性相当于getters
  const double = computed(() => {
    return count.value * 2;
  });

  //function函数就相当于actions
  function increment() {
    count.value++;
  }

  return { count, double, increment };
});
